{% if comments %}
<div class="panel panel-default">
    {% for comment in comments %}
    <div class="comment panel-body">
      <a href="/user/{{ comment.username }}" class="avatar"><img src="{{ comment.avatar }}"></a>
      <div style="margin-left: 50px;">
        <a class='topic-username' href="/user/{{ comment.username }}">{{ comment.username }}</a>
        {{ comment.comment_time.strftime('%Y-%m-%d %H:%M:%S') }}
        <div>{{ comment.comment }}</div>
      </div>
    </div>
    {% endfor %}
</div>
{% endif %}
{% if current_user.is_authenticated() %}
<form method="POST">
{{ form.hidden_tag() }}
{{ form.comment.label }}
{{ form.comment(class="form-control", rows=5) }}
{{ form.submit(class="btn btn-default") }}
</form>
{% else %}
<div class="panel panel-default">
  <div class="comment panel-body">
    <center>comment after <a href="/login">login</a></center>
  </div>
</div>
{% endif %}
